package com.pipayshop.mapper;

import com.pipayshop.domain.StoreCategory;
import com.pipayshop.domain.vo.StoreCategoryVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 实体店二级分类表 Mapper 接口
 * </p>
 *
 * @author nws
 * @since 2023-07-25
 */
@Mapper
public interface PhysicalStoreCategoryMapper extends BaseMapper<StoreCategory> {

    /**
     * 查找二级分类的id和内容的集合
     * @param categoryPid
     * @return
     */
    List<StoreCategoryVO> selectAllContentList(@Param("category_pid") String categoryPid);

    @Select("select content from store_category where category_id = #{categoryId}")
    String selectContent(String categoryId);

    List<StoreCategory> getShopCategoryByCategory(@Param("categoryPid") String categoryPid);
}
